<template>
  <div id="app" style="display: contents">
    <view-header v-bind:headerTitle="headerTitle" v-if="header_show"></view-header>
    <router-view v-on:setHeader="setHeader" style="overflow: hidden"/>
  </div>
</template>

<script>
import viewHeader from '@/components/view/common/Header'
export default {
  name: 'App',
  data () {
    return {
      header_show: true,
      headerTitle: ''
    }
  },
  components: {
    'view-header': viewHeader
  },
  mounted () {
    console.log(this.header_show)
  },
  methods: {
    // 是否显示头部
    setHeader: function (bool) {
      this.header_show = bool.headerShow
      this.headerTitle = bool.headerTitle
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
